<header class="page-header clearfix">
    <h4><a ng-href="#/my/image"><i class="fa fa-arrow-left"></i></a>配置管理：<span class="text-success">{{::list.MyimageName}}</span></h4>
    <div class="toolbox">
        <a ng-show="!list.adding" ng-click="list.addConfig()"><i class="fa fa-plus"></i>添加配置文件</a>
        <a ng-show="list.adding"><i class="fa fa-cog fa-lg fa-spin margin-right-5" />正在添加配置文件</a>
    </div>
    <ol class="breadcrumb">
        <li><a ng-href="#/my/image">我的镜像</a></li>
        <li class="active">配置管理</li>
    </ol>
</header>
<section>
    <ui-panel class="panel-list">
        <form class="form-inline form-search" ng-submit="list.search()">
            <div class="form-group">
                <input type="text" maxlength="50" ng-model="list.filter.name" class="form-control" placeholder="请输入配置文件名称查询" />
            </div>
            <button class="btn btn-default" type="submit">查询</button>
        </form>
        <p ng-show="list.table.length==0">无相关的配置文件</p>
    </ui-panel>
    <div class="panel panel-list service-detail-panel" ng-style="::elem.border" ng-repeat="elem in list.table">
        <div class="panel-body">
            <header class="form-search page-header clearfix" style="border-bottom:0;margin-bottom:0;margin-top:0;">
                <strong ng-style="::elem.color">{{::elem.configName}}</strong>
                <div class="toolbox" style="margin-left:0;">
                    <a ng-show="!list.adding" ng-click="list.addConfig(elem,1)"><i class="fa fa-plus"></i>添加配置版本</a>
                    <a ng-show="list.adding"><i class="fa fa-cog fa-lg fa-spin margin-right-5" />正在添加配置版本</a>
                </div>
            </header>
            <table class="table">
                <thead>
                    <tr>
                        <th width="8%">版本号</th>
                        <th width="35%">配置文件属性</th>
                        <th width="20%">创建时间</th>
                        <th style="width:80px;">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="row-head" ng-switch="elem.deleting">
                            {{::elem.configVersion}}
                            <div class="toolbox" ng-switch-default>
                                <a ng-click="list.deleteConfig(elem)" title="删除"><i class="fa fa-times fa-lg"></i></a>
                            </div>
                            <div class="toolbox tb-loading" ng-switch-when="true">
                                <div class="loading-sm" /></div>
                        </td>
                        <!--<td><i class="fa fa-info-circle configfile-info" ui-popover-template="list.infoHtml" popover-title="配置文件" popover-placement="right" popover-trigger="mouseenter"></i></td>-->
                        <td>
                            <div class="z-table-wrap">
                                <i class="fa text-info" ng-class="elem.open?'fa-chevron-circle-up':'fa-chevron-circle-down'" ng-click="list.openConfigInfo(elem,$event)"></i>
                                <table ng-show="elem.config.length>0" class="table" style="margin-bottom:0;">
                                <thead>
                                    <tr>
                                        <th>key</th>
                                        <th>value</th>
                                        <th>备注</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr ng-repeat="item in elem.config">
                                        <td>{{item.key}}</td>
                                        <td>{{item.value}}</td>
                                        <td>{{item.remark}}</td>
                                    </tr>
                                </tbody>
                            </table>
                            </div>
                        </td>
                        <td>{{::elem.createTime | date: 'yyyy-MM-d HH:mm:ss'}}</td>
                        <td>
                            <a href="" ng-click="list.addConfig(elem,2)">编辑</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    
    <!--Loading-->
    <div class="loading" style="margin:0 auto;" ng-show="!list.table"></div>
    <!--分页-->
    <div ng-show="list.table" class="pagination-group">
        <ui-pagination-info items-per-page="list.page.page" items-per-page-select="false" total-items="list.page.totalItems" current-page="list.page.currentPage"></ui-pagination-info>
        <button type="button" ng-click="list.getList()" class="btn btn-default btn-refresh"><i
                    class="fa fa-refresh"></i></button>
        <ui-pagination items-per-page="list.page.page" total-items="list.page.totalItems" ng-model="list.page.currentPage" ng-change="list.getList()"></ui-pagination>
    </div>
</section>